# from tqdm import tqdm
# import time
#
# for i in tqdm(range(100)):
#     time.sleep(0.1)  # 假装在处理数据


# from rich import print
# from rich.console import Console
# from rich.table import Table
#
# console = Console()  # 炫彩输出
# print("[red]警告[/red]: 系统遇到一个小问题")  # 表格输出
# table = Table(title="成绩单")
# table.add_column("姓名")
# table.add_column("分数")
# table.add_row("小明", "98")
# table.add_row("小红", "96")
# console.print(table)

import ttkbootstrap as ttk
from ttkbootstrap.constants import *
import time

def start_progress():
    progress_bar["value"] = 0
    root.update_idletasks()
    for i in range(101):
        progress_bar["value"] = i
        time.sleep(0.03)  # 模拟任务
        root.update_idletasks()
    label.config(text="Task Completed!")

# 创建主窗口
root = ttk.Window(themename="flatly")
root.title("Progress Bar Example")
root.geometry("300x150")

# 标签
label = ttk.Label(root, text="Click 'Start' to begin", font=("Arial", 12))
label.pack(pady=10)

# 进度条
progress_bar = ttk.Progressbar(root, orient="horizontal", length=200, mode="determinate")
progress_bar.pack(pady=10)

# 按钮
start_button = ttk.Button(root, text="Start", command=start_progress, bootstyle="success")
start_button.pack(pady=10)

root.mainloop()


